package com.lft.com.oilgas.mapper;

import com.lft.com.oilgas.entity.Commodity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author tyqw
 * @since 2024-09-10
 */
public interface CommodityMapper extends BaseMapper<Commodity> {
    @Select("SELECT `commodity`.id,`commodity`.name,`commodity_role`.`name`  as  productType,commodity_price,selling_point,inventory,status,merchant_id FROM commodity LEFT OUTER JOIN `commodity_role` on  `commodity`.`product_type`=`commodity_role`.`id` WHERE (merchant_id = #{id})")
    List<Commodity> selectByMerchantId( Integer id);
}
